//
//  TextTableViewCell.m
//  SoundPill
//
//  Created by 宋旭东 on 15/6/9.
//  Copyright (c) 2015年 宋旭东. All rights reserved.
//

#import "TextTableViewCell.h"

@implementation TextTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.frame = CGRectMake(0, 0, self.frame.size.width / 2, self.frame.size.height);
//        NSLog(@"%f", self.frame.size.width);
        [self createSubviews];
    }
    return self;
}

- (void)createSubviews
{
    self.textShow = [[UITextView alloc] initWithFrame:CGRectMake(0, 5, self.frame.size.width - 10, self.frame.size.height - 5)];
    _textShow.backgroundColor = [UIColor whiteColor];
    _textShow.font = [UIFont systemFontOfSize:16];
    _textShow.textAlignment = NSTextAlignmentLeft;
    _textShow.returnKeyType = UIReturnKeyDone;
    [self addSubview:_textShow];
    
    self.deleteText = [UIButton buttonWithType:UIButtonTypeCustom];
    
    [_deleteText setImage:[UIImage imageNamed:@"edit_delete_button"] forState:UIControlStateNormal];
//    _deleteText.backgroundColor = [UIColor redColor];
    [self addSubview:_deleteText];
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    _textShow.frame = CGRectMake(5, 0, self.frame.size.width - 10, self.frame.size.height - 7);
    _deleteText.frame = CGRectMake(self.frame.size.width - 20, self.frame.size.height - 27, 20, 20);
}
@end
